<template>
  <div>
    <MyHeader title="购物车" bgc="orange" color="green"></MyHeader>
    <div class="main">
      <MyGoods v-for="obj in goodList" :key="obj.id" :obj="obj"></MyGoods>
    </div>
    <MyFooter :list="goodList"></MyFooter>
  </div>
</template>
 
<script>
import MyHeader from '@/components/MyHeader'
import MyGoods from '@/components/MyGoods'
import MyFooter from '@/components/MyFooter'
export default {
  components: {
    MyHeader,
    MyGoods,
    MyFooter
  },
  data() {
    return {
      goodList: []
    }
  },
  created(){
    this.$axios({
      url: '/api/cart'
    }).then(res => {
      console.log(res)
      this.goodList = res.data.list
    })
  },
  methods: {}
}
</script>

<style scoped>
.main{
  padding-top: 45px;
  padding-bottom: 51px;
}
</style>